package com.zhengshang.common.constant;

/**
 * 通用常量信息
 *
 * @author ruoyi
 */
public class CommonConstants {

    public static Boolean isTest = false;

    public static String getDomain() {
        if (isTest) {
            return "http://t_api.youhuiniuapp.com/";
        } else {
            return "https://www.youhuiniuapp.com/";
        }
    }

    /**
     * 微信回调地址（会员购买）
     *
     * @return
     */
    public static String getWxNotifyUrl() {
        return getDomain() + "api/wxPay/gateway";
    }

    /**
     * 支付宝回调地址（会员购买）
     *
     * @return
     */
    public static String getAliNotifyUrl() {
        return getDomain() + "api/alipay/gateway";
    }

    /**
     * 获取证书路径
     *
     * @return
     */
    public static String getPrivateCertPath() {
        if (isTest) {
            return "C:/crt/apiclient_cert.p12";
        } else {
            return "D:/crt/apiclient_cert.p12";
        }
    }

    /**
     * 支付宝根证书路径
     *
     * @return
     */
    public static String getAlipayRootCert() {
        if (isTest) {
            return "c:/crt/alipayRootCert.crt";
        } else {
            return "d:/crt/alipayRootCert.crt";
        }
    }

    /**
     *  支付宝公钥证书路径
     *
     * @return
     */
    public static String getAlipayCertPath() {
        if (isTest) {
            return "c:/crt/alipayCertPublicKey_RSA2.crt";
        } else {
            return "d:/crt/alipayCertPublicKey_RSA2.crt";
        }
    }

    /**
     *  应用公钥证书路径
     *
     * @return
     */
    public static String getAppCertPath() {
        if (isTest) {
            return "c:/crt/appCertPublicKey_2021002132686077.crt";
        } else {
            return "d:/crt/appCertPublicKey_2021002132686077.crt";
        }
    }
}
